package cn.jiyun.controller;

import cn.jiyun.common.config.Result;
import cn.jiyun.pojo.Log;
import cn.jiyun.pojo.Log2;
import cn.jiyun.service.Log2Service;
import cn.jiyun.service.LogService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("log2")
@CrossOrigin
public class Log2Controller {
    @Autowired
    private Log2Service log2Service;

    @RequestMapping("/findPage")
    public Result findPage(Integer pageNum, Integer pageSize,@RequestBody Log2 log2){
        Page page=log2Service.findPage(pageNum,pageSize,log2);
        return  Result.ok(page);
    }

    @RequestMapping("/findById")
    public Result findById(Integer id){
        Log2 log2=log2Service.getById(id);
        return Result.ok(log2);
    }
}
